<!--小额预对账申请页面-->
<template>
  <div class="app-container">
    <el-form ref="submitParams" :model="submitParams" :rules="rules" label-width="120px">
      <el-row>
        <el-col :offset="6" :span="10">
          <el-form-item label="对账日期：" prop="reconDate">
            <el-date-picker
              v-model="submitParams.reconDate"
              type="date"
              value-format="yyyyMMdd"
              placeholder=""
              disabled
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="submitForm" :loading="isLoading">提交申请</el-button>
    </div>
  </div>
</template>

<script>
import { submit } from "@/api/cnaps/bizMng/beps_pre_reconciliation_apply.js";
import { listPageMixin } from "@/libs/listPageMixin";
import { mapGetters } from "vuex";
export default {
  name: "BepsPreReconciliationApply",
  mixins: [listPageMixin],
  components: {},
  computed: {},
  data() {
    return {
      isLoading: false,
      // 录入参数
      submitParams: {
        reconDate: "",
      },
      rules: {
        reconDate: [{ required: true, message: "不能为空", trigger: "change" }],
      },
    };
  },
  mounted() {
    this.$set(this.submitParams, "reconDate", this.globalBusData.bepsDate);
  },
  computed: {
    ...mapGetters(["globalBusData"]),
  },
  methods: {
    /** 提交按钮 */
    submitForm() {
      this.$refs["submitParams"].validate((valid) => {
        if (valid) {
          this.isLoading = true;
          submit(this.submitParams)
            .then(() => {
              this.msgSuccess("提交成功");
              this.isLoading = false;
            })
            .catch((err) => {
              this.isLoading = false;
            });
        }
      });
    },
  },
};
</script>
<style>
.dialog-footer {
  margin: 20px 0;
  text-align: center;
}
</style>
